package com.kitty.cross.core.codec;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;
//后加
import com.kitty.cross.core.codec.CrossMessageDecoder;
import com.kitty.cross.core.codec.CrossMessageEncoder;

public class CrossMessageCodecFactory implements ProtocolCodecFactory {

    private CrossMessageDecoder decoder = new CrossMessageDecoder();

    private CrossMessageEncoder encoder = new CrossMessageEncoder();

    @Override
    public ProtocolEncoder getEncoder(IoSession session) throws Exception {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return decoder;
    }

}
